<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>终焉之地</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: '微软雅黑', 'Arial', sans-serif;
        }

        body {
            overflow: hidden;
            height: 100vh;
            background-color: #000;
            color: #fff;
        }

        .page {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: none;
            transition: opacity 1s ease;
        }

        .page.active {
            display: flex;
            opacity: 1;
        }

        /* 初始页面样式 */
        #start-page {
            background: radial-gradient(circle at center, #3a0000 0%, #000 70%);
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }

        .title {
            font-size: 6rem;
            font-weight: bold;
            color: #ff3a3a;
            text-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
            margin-bottom: 2rem;
            animation: pulse 3s infinite alternate;
        }

        @keyframes pulse {
            from { text-shadow: 0 0 20px rgba(255, 0, 0, 0.8); }
            to { text-shadow: 0 0 40px rgba(255, 0, 0, 1); }
        }

        .continue-btn {
            background-color: rgba(255, 0, 0, 0.5);
            color: #fff;
            border: 2px solid #ff3a3a;
            padding: 1rem 3rem;
            font-size: 1.5rem;
            cursor: pointer;
            border-radius: 5px;
            transition: all 0.3s ease;
        }

        .continue-btn:hover {
            background-color: rgba(255, 0, 0, 0.8);
            transform: scale(1.05);
            box-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
        }

        /* 选择页面样式 */
        #choices-page {
            background: linear-gradient(135deg, #1a1a1a 0%, #2d0000 100%);
            flex-direction: column;
            justify-content: center;
            align-items: center;
            gap: 2rem;
        }

        .choices-title {
            font-size: 2rem;
            color: #ffcccc;
            margin-bottom: 2rem;
        }

        .choice-btn {
            background-color: rgba(50, 0, 0, 0.7);
            color: #fff;
            border: 2px solid #ff3a3a;
            padding: 1.5rem 4rem;
            font-size: 1.8rem;
            cursor: pointer;
            border-radius: 5px;
            transition: all 0.3s ease;
            width: 60%;
            max-width: 400px;
        }

        .choice-btn:hover {
            background-color: rgba(100, 0, 0, 0.7);
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
        }

        /* 图片展示页面样式 */
        #image-page {
            background-color: #000;
            justify-content: center;
            align-items: center;
            position: relative;
        }

        #display-image {
            max-width: 90%;
            max-height: 90%;
            box-shadow: 0 0 30px rgba(255, 0, 0, 0.3);
            border: 2px solid rgba(255, 0, 0, 0.5);
        }

        .timer {
            position: absolute;
            top: 20px;
            right: 20px;
            background-color: rgba(0, 0, 0, 0.7);
            padding: 10px 20px;
            border-radius: 20px;
            border: 1px solid #ff3a3a;
        }

        /* 选择弹窗样式 */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.8);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }

        .modal.active {
            display: flex;
        }

        .modal-content {
            background-color: #1a1a1a;
            padding: 2rem;
            border-radius: 10px;
            text-align: center;
            border: 2px solid #ff3a3a;
            width: 90%;
            max-width: 400px;
        }

        .modal-title {
            font-size: 1.5rem;
            margin-bottom: 1.5rem;
            color: #ffcccc;
        }

        .modal-buttons {
            display: flex;
            justify-content: center;
            gap: 1rem;
        }

        .modal-btn {
            padding: 0.8rem 2rem;
            font-size: 1rem;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .continue-modal-btn {
            background-color: #4CAF50;
            color: white;
        }

        .continue-modal-btn:hover {
            background-color: #45a049;
        }

        .not-continue-modal-btn {
            background-color: #f44336;
            color: white;
        }

        .not-continue-modal-btn:hover {
            background-color: #d32f2f;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .title {
                font-size: 4rem;
            }
            
            .choice-btn {
                font-size: 1.5rem;
                padding: 1rem 2rem;
                width: 80%;
            }
        }

        @media (max-width: 480px) {
            .title {
                font-size: 2.5rem;
            }
            
            .continue-btn {
                padding: 0.8rem 2rem;
                font-size: 1.2rem;
            }
            
            .modal-content {
                padding: 1.5rem;
            }
        }
    </style>
</head>
<body>
    <!-- 初始页面 -->
    <div id="start-page" class="page active">
        <h1 class="title">终焉之地</h1>
        <button class="continue-btn" onclick="goToChoices()">继续</button>
    </div>

    <!-- 选择页面 -->
    <div id="choices-page" class="page">
        <h2 class="choices-title">请选择查看内容</h2>
        <button class="choice-btn" onclick="showImage('生肖')">生肖</button>
        <button class="choice-btn" onclick="showImage('参与者')">参与者</button>
    </div>

    <!-- 图片展示页面 -->
    <div id="image-page" class="page">
        <img id="display-image" src="" alt="展示图片">
        <div class="timer" id="timer">30秒后自动提示</div>
    </div>

    <!-- 继续/不继续弹窗 -->
    <div id="choice-modal" class="modal">
        <div class="modal-content">
            <h3 class="modal-title">是否结束？</h3>
            <div class="modal-buttons">
                <button class="modal-btn continue-modal-btn" onclick="endProgram()">继续</button>
                <button class="modal-btn not-continue-modal-btn" onclick="showNextImage()">不继续</button>
            </div>
        </div>
    </div>

    <script>
        // 图片路径配置 - 请将这里的路径替换为您自己的图片路径
        // 生肖相关图片
        const zodiacImages = [
            "终焉之地欢迎.png",  // 替换为您的生肖图片1路径
        ];
        
        // 参与者相关图片
        const participantImages = [
            "终焉之地欢迎.png",  // 替换为您的参与者图片1路径
        ];
        
        // 当前状态变量
        let currentChoice = "";
        let currentImageIndex = 0;
        let timerInterval;
        let remainingTime = 30;

        // 页面切换函数
        function goToChoices() {
            document.getElementById("start-page").classList.remove("active");
            document.getElementById("choices-page").classList.add("active");
        }

        // 显示图片函数
        function showImage(choice) {
            currentChoice = choice;
            currentImageIndex = 0;
            remainingTime = 30;
            
            // 根据选择设置图片源
            const imageElement = document.getElementById("display-image");
            if (choice === "生肖") {
                imageElement.src = zodiacImages[currentImageIndex];
            } else {
                imageElement.src = participantImages[currentImageIndex];
            }
            
            // 切换到图片页面
            document.getElementById("choices-page").classList.remove("active");
            document.getElementById("image-page").classList.add("active");
            
            // 开始倒计时
            startTimer();
        }

        // 开始倒计时
        function startTimer() {
            // 清除之前的计时器
            if (timerInterval) {
                clearInterval(timerInterval);
            }
            
            // 更新显示
            updateTimerDisplay();
            
            // 设置新计时器
            timerInterval = setInterval(() => {
                remainingTime--;
                updateTimerDisplay();
                
                // 时间到，显示弹窗
                if (remainingTime <= 0) {
                    clearInterval(timerInterval);
                    document.getElementById("choice-modal").classList.add("active");
                }
            }, 1000);
        }

        // 更新计时器显示
        function updateTimerDisplay() {
            document.getElementById("timer").textContent = `${remainingTime}秒后自动提示`;
        }

        // 显示下一张图片
        function showNextImage() {
            // 隐藏弹窗
            document.getElementById("choice-modal").classList.remove("active");
            
            // 计算下一张图片索引
            if (currentChoice === "生肖") {
                currentImageIndex = (currentImageIndex + 1) % zodiacImages.length;
                document.getElementById("display-image").src = zodiacImages[currentImageIndex];
            } else {
                currentImageIndex = (currentImageIndex + 1) % participantImages.length;
                document.getElementById("display-image").src = participantImages[currentImageIndex];
            }
            
            // 重置计时器
            remainingTime = 30;
            startTimer();
        }

        // 结束程序
        function endProgram() {
            // 在浏览器环境中，我们无法真正关闭窗口，所以这里刷新页面回到初始状态
            location.reload();
            
            // 如果是在Electron等桌面环境中，可以使用:
            // window.close();
        }

        // 处理图片加载错误
        document.getElementById("display-image").addEventListener("error", function() {
            alert("图片加载失败，请检查图片路径是否正确。");
            // 回到选择页面
            document.getElementById("image-page").classList.remove("active");
            document.getElementById("choices-page").classList.add("active");
            clearInterval(timerInterval);
        });
    </script>
</body>
</html>
